package com.ten.order.controller;

import com.ten.common.core.entity.EduCourse;
import com.ten.common.core.vo.Result;
import com.ten.order.feign.CourseListFeign;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：王薪伟
 * @date ：Created in 2022/12/7 23:15
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/order/course")
@Api(tags = "课程信息接口类")
public class CourseController {

    @Autowired
    private CourseListFeign courseListFeign;


    //根据课程id查询课程信息
    @ApiOperation(value = "根据课程id查询课程信息")
    @ApiImplicitParams(
            {
                    @ApiImplicitParam(value = "课程id", name = "courseId")
            }
    )
    @PostMapping("queryAllCourse/{courseId}")
    public Result<List<EduCourse>> queryAllCourse(@PathVariable String courseId) {
        Result<List<EduCourse>> result = courseListFeign.selectByCourseId(courseId);
        return result;
    }
}
